
#include <iostream>
#include <vector>

using namespace std;

vector<int> decToBin(int n) {
  vector<int> result;
  
  while (n != 0) {
    result.push_back(n % 2);
    n /= 2;
  }
  reverse(result.begin(), result.end());
  return result;
}

int main(int argc, char const *argv[]) {
  vector<int> bits = decToBin(13);
  for (int bit : bits) {
    cout << bit << " ";
  }
  cout << endl;
  return 0;
}
